﻿Imports DMC.Land.TimKiem
Imports System.Data.SqlClient
Public Class frmHoSoPhuongGuiLenQuan
    Private connection As String = ""
    Private blnXacNhanKetQuaTimKiem As Boolean = False
    Public Property XacNhanKetQuaTimKiem() As Boolean
        Get
            Return blnXacNhanKetQuaTimKiem
        End Get
        Set(ByVal value As Boolean)
            blnXacNhanKetQuaTimKiem = value
        End Set
    End Property
    Public Sub UpdateData()
        Try
            Dim MaHoSoCapGCN As String = "0"
            Dim ToBanDo As String = ""
            Dim SoThua As String = ""
            Dim DienTich As String = ""
            Dim DiaChiDat As String = ""
            Dim MaThuaDat As String = ""
            Dim MaDonViHanhChinh As String = ""
            With Me.CtrPhuongTheoDoi1
                MaHoSoCapGCN = .MaHoSoCapGCN
                strGlbMaHoSo = .MaHoSoCapGCN
                ToBanDo = .ToBanDo
                strGlbToBanDo = .ToBanDo
                SoThua = .SoThua
                strGlbSoThua = .SoThua
                DiaChiDat = .DiaChiThua
                strGlbDiaChi = .DiaChiThua
                DienTich = .DienTich
                strGlbDienTich = .DienTich
                ' MaThuaDat = .MaThuaDat
                MaDonViHanhChinh = .MaDonViHanhChinh
                strGlbMaThuaDat = .MaThuaDat
            End With
            connection = GetConnection(bolKetNoiCSDL)
            Dim con As New SqlConnection(connection)
            Dim Cmd As New SqlCommand("spInsert10ThuaDatMoiThaoTac", con)
            Cmd.CommandType = CommandType.StoredProcedure
            Dim Para As New SqlParameter
            Para = Cmd.Parameters.Add("@MaHoSoCapGCN", SqlDbType.BigInt)
            Para.Value = Integer.Parse(MaHoSoCapGCN)
            Para = Cmd.Parameters.Add("@ToBanDo", SqlDbType.NVarChar, 20)
            Para.Value = ToBanDo
            Para = Cmd.Parameters.Add("@SoThua", SqlDbType.NVarChar, 10)
            Para.Value = SoThua
            'Para = Cmd.Parameters.Add("@DienTich", SqlDbType.Float)
            'Para.Value = Double.Parse(DienTich)
            Para = Cmd.Parameters.Add("@DiaChiDat", SqlDbType.NVarChar, 500)
            Para.Value = DiaChiDat
            Para = Cmd.Parameters.Add("@MaThuaDat", SqlDbType.NVarChar, 20)

            Para.Value = MaThuaDat

            Para = Cmd.Parameters.Add("@MaDonViHanhChinh", SqlDbType.Int)
            Para.Value = Integer.Parse(MaDonViHanhChinh)
            Para = Cmd.Parameters.Add("@UserName", SqlDbType.NVarChar, 50)
            Para.Value = User.UserName
            con.Open()
            Cmd.ExecuteNonQuery()
            con.Close()
        Catch
        End Try

    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        UpdateData()
        blnXacNhanKetQuaTimKiem = True
        frmNghiepVuHoSo.CtrlNghiepVuHoSo1.GuiHoSoLenQuan()
        'frmMain.HienThiNghiepVu(blnXacNhanKetQuaTimKiem)
        Me.Hide()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        blnXacNhanKetQuaTimKiem = False
        Me.Hide()
    End Sub
End Class